//------------------------------------------------------------------------------
// Fichiers d'entée utilisé
//------------------------------------------------------------------------------
#include "Mask.hpp"

//------------------------------------------------------------------------------
// D�inition de constantes
//------------------------------------------------------------------------------

namespace ImageAnalysis
{

        //----------------------------------------------------------------------
        // Constructeur
        //----------------------------------------------------------------------
        Mask::Mask( int size, Orientation::TDirection direction )
        {
            this->Size = size;
            this->Direction = direction;
            this->Value = new int[size*size];
        }

        //----------------------------------------------------------------------
        //
        //----------------------------------------------------------------------
        Mask * Mask::BuildMask( Mask& originalMask, Orientation::TDirection targetDirection )
        {
            return 0;
        }

        //----------------------------------------------------------------------
        // Destructeur
        //----------------------------------------------------------------------
    	Mask::~Mask()
    	{
            if( Value != 0 )
            {   delete[] Value; }
        }


		//----------------------------------------------------------------------
        // Destructeur
        //----------------------------------------------------------------------
    	unsigned int Mask::GetMaximumNormalizeCoefficient()
    	{
            unsigned int positiveCoefficient = 0;
            unsigned int negativeCoefficient = 0;
	    unsigned int toalSize = Size*Size;
            for( int i=0; i< toalSize; ++i)
            {
                if( Value[i] > 0 )
                {	positiveCoefficient += Value[i]; }
                if( Value[i] < 0)
                {	negativeCoefficient += Value[i]; }
            }
            return positiveCoefficient>-negativeCoefficient?positiveCoefficient:-negativeCoefficient;
        }

}
